function NHelpers(){}NHelpers.prototype=new NHelpers();NHelpers.EndsWith=function(a,b){return(a.substr(a.length-b.length)===b)};NHelpers.StartsWith=function(b,a){return(b.substr(0,a.length)===a)};NHelpers.CreateEmptyDiv=function(){var a=document.createElement("div");$(a).css("border-width",0);$(a).css("min-width",0);$(a).css("min-height",0);$(a).css("font-size",0);return a};NHelpers.EncodeToHex=function(g){var f="";var b=g.length;var a=0;var d;while(a=this.Y)&&(a.Y<=(this.Y+this.Height))){if((a.X>=this.X)&&(a.X<=(this.X+this.Width))){return true}}return false};NRect.prototype.Equals=function(a){return(this.X==a.X)&&(this.Y==a.Y)&&(this.Width==a.Width)&&(this.Height==a.Height)};NRect.prototype.GetRight=function(){return this.X+this.Width};NRect.prototype.GetBottom=function(){return this.Y+this.Height};NRect.prototype.GetPointInRect=function(c){var b=new NPoint();b.X=c.X;b.Y=c.Y;if(b.Xd){b.X=d}}if(b.Ya){b.Y=a}}return b};NRect.prototype.Inflate=function(b){var a=new NRect(this.X,this.Y,this.Width,this.Height);a.Width+=b.Width;a.Height+=b.Height;return a};NRect.FromString=function(b){var a=b.split(",");return new NRect(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]))};function NRangeRect(b,d,c,a){this.Left=b;this.Top=d;this.Right=c;this.Bottom=a}NRangeRect.prototype=new NShape();NRangeRect.prototype.Contains=function(a){if((a.Y>=this.Top)&&(a.Y<=this.Bottom)){if((a.X>=this.Left)&&(a.X<=this.Right)){return true}}return false};NRangeRect.prototype.Equals=function(a){return(this.Left==a.Left)&&(this.Top==a.Top)&&(this.Right==a.Right)&&(this.Bottom==a.Bottom)};NRangeRect.FromString=function(b){var a=b.split(",");return new NRangeRect(a[0],a[1],a[2],a[3])};function NPolygon(a){this.Coords=a}NPolygon.prototype=new NShape();NPolygon.prototype.Contains=function(g){var a=false;var d=-1;var b=this.Coords;var f=b.length;var e=f-1;for(;++d=a){return null}return this.GetChildAt(b)};NClientNode.prototype.ContainsDocumentPoint=function(c){var b=$(this.HtmlElement).offset();var d=$(this.HtmlElement).width();var a=$(this.HtmlElement).height();return((c.X>=b.left)&&(c.X=b.top)&&(c.Y=0;e-=1){g=b[e].name;if(typeof c[g]==="function"){c[g]=null}}}b=c.childNodes;if(b){f=b.length;for(e=0;e=0;c--){var a=this.GetChildAt(c);if(a!=null){a.RemoveThis()}}};NClientNode.prototype.RemoveChildrenInRange=function(a,d){var c=this.GetChildrenCount();var e=0;for(e=d;e>=a;e--){var b=this.GetChildAt(e);if(b!=null){b.RemoveThis()}}};NClientNode.prototype.RemoveAllBackbufferChildren=function(){var b=this.GetChildrenCount();var c=0;for(c=b-1;c>=0;c--){var a=this.GetChildAt(c);if(a!=null&&a.BackBuffer!=null){a.RemoveThis()}}};NClientNode.prototype.MarkAllChildrenAsBackBuffer=function(c){var b=this.GetChildrenCount();var e=0;var d=this.GetRoot();for(e=b-1;e>=0;e--){var a=this.GetChildAt(e);if(a!=null&&a!=c){a.BackBuffer=true}}};NClientNode.prototype.GetChildContainingPoint=function(c){if(this.HtmlElement==null||this.HtmlElement.childNodes==null){return null}var b=0;for(b=this.GetChildrenCount()-1;b>=0;b--){var a=this.GetChildAt(b);if(a!=null&&a.ContainsDocumentPoint(c)){return a}}return null};NClientNode.prototype.GetDescendantContainingPoint=function(b){if(!this.ContainsDocumentPoint(b)){return null}var a=this.GetChildContainingPoint(b);if(a!=null){return a.GetDescendantContainingPoint(b)}return this};NClientNode.prototype.GetLeft=function(){return $(this.HtmlElement).position().left};NClientNode.prototype.SetLeft=function(a){$(this.HtmlElement).css("left",a+"px")};NClientNode.prototype.GetTop=function(){return $(this.HtmlElement).position().top};NClientNode.prototype.SetTop=function(a){$(this.HtmlElement).css("top",a+"px")};NClientNode.prototype.GetWidth=function(){return $(this.HtmlElement).width()};NClientNode.prototype.SetWidth=function(a){$(this.HtmlElement).css("width",a+"px")};NClientNode.prototype.GetHeight=function(){return $(this.HtmlElement).height()};NClientNode.prototype.SetHeight=function(a){$(this.HtmlElement).css("height",a+"px")};NClientNode.GetFromHtmlElement=function(a){if(a==null){return null}return a.ClientNode};NClientNode.GetFromId=function(a){if(a==null||a.length==0){return null}return NClientNode.GetFromHtmlElement($("#"+a)[0])};function NButtonBase(){}NButtonBase.prototype=new NClientNode();NButtonBase.prototype.GetEnabled=function(){if(this.HtmlElement==null){return false}return !$(this.HtmlElement).disabled};NButtonBase.prototype.SetEnabled=function(a){if(this.HtmlElement==null){return}if(a){$(this.HtmlElement).disabled=false}else{$(this.HtmlElement).disable=true}if(a){$(this.HtmlElement).removeClass("NStateDisabled")}else{$(this.HtmlElement).addClass("NStateDisabled")}};NButtonBase.prototype.GetMouseOver=function(){if(this.HtmlElement==null){return false}return this.MouseOver};NButtonBase.prototype.SetMouseOver=function(a){if(this.HtmlElement==null){return}this.MouseOver=a;$(this.HtmlElement).attr("ismouseover",a)};NButtonBase.prototype.GetPressed=function(){if(this.HtmlElement==null){return false}return this.Pressed};NButtonBase.prototype.SetPressed=function(a){if(this.HtmlElement==null){return}this.Pressed=a;if(a){$(this.HtmlElement).addClass("NStatePressed")}else{$(this.HtmlElement).removeClass("NStatePressed")}};NButtonBase.prototype.GetChecked=function(){if(this.HtmlElement==null){return false}return this.Checked};NButtonBase.prototype.SetChecked=function(a){if(this.HtmlElement==null){return}this.Checked=a;$(this.HtmlElement).attr("ischecked",a)};NButtonBase.prototype.IsPressed=function(){return this.GetPressed()};NButtonBase.prototype.IsMouseOver=function(){return this.GetMouseOver()};NButtonBase.prototype.CreateButtonBase=function(){var a=this;var b=$(this.HtmlElement);NHelpers.MarkAsNonSelectable(this.HtmlElement);this.SetEnabled(true);this.SetMouseOver(false);this.SetPressed(false);this.SetChecked(false);b.addClass("NStateDefault");b.hover(function(){if(!a.GetEnabled()){return}a.SetMouseOver(true);a.UpdateButton()},function(){if(!a.GetEnabled()){return}a.SetMouseOver(false);a.UpdateButton()});b.mousedown(function(c){if(!a.GetEnabled()||c.which!=1){return}a.SetPressed(true);a.UpdateButton()});b.mouseup(function(c){if(!a.GetEnabled()||c.which!=1){return}a.SetPressed(false);a.UpdateButton()})};NButtonBase.prototype.UpdateButtonStyles=function(){if(this.HtmlElement==null){return}var a=$(this.HtmlElement);if(this.GetEnabled()){if(this.IsPressed()==true){a.removeClass("NStateHover").addClass("NStatePressed");return}if(this.IsMouseOver()==true){a.removeClass("NStatePressed").addClass("NStateHover");return}}a.removeClass("NStatePressed NStateHover")};NButtonBase.prototype.UpdateContent=function(){};NButtonBase.prototype.UpdateButton=function(){this.UpdateContent();this.UpdateButtonStyles()};function NBreathFirstNodeEnumerator(a){this.Queue=new Array();this.Queue.push(a)}NBreathFirstNodeEnumerator.prototype.MoveNext=function(){if(this.Queue.length==0){return null}while(true){var b=this.Queue.pop();var a=b.GetChildrenCount();if(a>0){this.Queue.push(b);for(i=0;ithis.m_AutoCategoryMaxValue){this.m_AutoCategoryCount=this.m_AutoCategoryBeginValue}}if(d==null){d=NPostQueue2.LowPriority}var b=this.m_RequestCounter;this.m_Requests.push({url:f,data:null,successCallback:e,category:a,priority:d,requestId:b,postCallback:c});this.m_RequestCounter++;if(this.m_RequestCounter>this.m_RequestCounterMaxValue){this.m_RequestCounter=0}this.CleanRequestsWithEqualCategory();this.DequeueRequest();return b};NPostQueue2.prototype.DequeueRequest=function(){var f=this.m_Requests.length;if(f!=0&&!this.m_Blocked){var c;var g=0;var e=this.m_Requests[0];for(c=1;ce.priority){e=b;g=c}}var d=this;this.m_Requests.splice(g,1);this.m_Blocked=true;if(e.postCallback!=null){e.postCallback()}else{var a=$.ajax({url:e.url,success:function(h){d.m_Blocked=false;e.successCallback(h);d.DequeueRequest();e=null;d=null;h=null},error:function(h){d.m_Blocked=false;d.DequeueRequest();e=null;d=null}});a.onreadystatechange=null;a.abort=null;a=null}}};NPostQueue2.prototype.AbortRequestWithId=function(d){var b;var a=this.m_Requests.length;for(b=0;b=0;b--){var a=this.m_Requests[b];if(a.category!=c.category){continue}d=true;this.m_Requests.splice(b,1)}}};function NClientHost(c,e,d,b,f){this.ServiceUrl=e;this.PageUrl=d;this.CommandProcessor=b;this.CommandProcessor.Host=this;this.SetHtmlElementNoId(c);this.ViewHost=new NViewHost(this,f);this.Controller=new NController(this.ViewHost,f);this.Tooltip=null;this.FreezeScrolling=false;this.PostQueue=new NPostQueue2();if(typeof(Sys)!=="undefined"){if(typeof(Sys.Application)!=="undefined"){if(!nclientHostRegisteredAsDisposable){NClientHost.registerClass("NClientHost",null,Sys.IDisposable);nclientHostRegisteredAsDisposable=true}Sys.Application.registerDisposableObject(this)}}var a=this;c.dispose=function(){a.dispose()}}var nclientHostRegisteredAsDisposable=false;NClientHost.prototype=new NClientNode();NClientHost.prototype.dispose=function(){this.RemoveFromTree();if(typeof(Sys)!=="undefined"){if(typeof(Sys.Application)!=="undefined"){Sys.Application.unregisterDisposableObject(this)}}};if(typeof(Sys)!=="undefined"){if(typeof(Sys.Application)!=="undefined"){Sys.Application.notifyScriptLoaded()}}NClientHost.prototype.GetLoadStateRequest=function(){return NRequest.GetLoadStateRequest(this.HtmlElement.id)};NClientHost.prototype.ExecuteCustomRequest=function(a,b,c){this.ExecuteServiceRequest(NRequest.CustomRequest(a),b,c)};NClientHost.prototype.ExecuteWindowCustomRequest=function(a){this.ExecuteWindowRequest(NRequest.CustomRequest(a))};NClientHost.prototype.ExecutePageRequest=function(c,a,b){var e=new Array();e.push(this.GetLoadStateRequest());e.push(NRequest.GetEnforceBrowserRefreshRequest());e.push(c);var d=new NRequestList(e);return this.PagePost(d,a,b)};NClientHost.prototype.ExecuteWindowRequest=function(a){var c=new Array();c.push(this.GetLoadStateRequest());c.push(NRequest.GetEnforceBrowserRefreshRequest());c.push(a);var b=new NRequestList(c);window.open(this.ServiceUrl+"?Request="+b.Pack())};NClientHost.prototype.ExecuteServiceRequest=function(c,a,b){var d=new Array();d.push(this.GetLoadStateRequest());d.push(NRequest.GetEnforceBrowserRefreshRequest());d.push(c);return this.ServicePost(new NRequestList(d),a,b)};NClientHost.prototype.ServicePost=function(d,a,c){var b=this;return this.UrlPost(this.ServiceUrl+"?Request="+d.Pack(),a,c)};NClientHost.prototype.PagePost=function(c,a,b){return this.UrlPost(this.PageUrl+"?Request="+c.Pack(),a,b)};NClientHost.prototype.UrlPost=function(d,a,c){var b=this;this.SafeDestroyTooltip();return this.PostQueue.EnqueueRequest(d,function(e){b.HandleResponse(e)},a,c)};function getBase(){return this}var execCounter=0;NClientHost.prototype.HandleResponse=function(b){var a=this.CommandProcessor;a.SetStream(b);a.ProcessCommands();a.Reset()};NClientHost.prototype.SafeDestroyTooltip=function(){if(this.Tooltip!=null){var a=this.Tooltip;this.Tooltip=null;a.Destroy()}};NClientHost.prototype.GetImageMapInfo=function(b){var a=this.GetDescendantContainingPoint(b.PageCoords);if(a==null){return null}if(a.ImageMap==null){return null}var c=$(a.HtmlElement).offset();var d=b.PageCoords.X-c.left;var e=b.PageCoords.Y-c.top;return a.ImageMap.GetInfoFromPoint(new NPoint(d,e))};NClientHost.prototype.CreateCaptureDiv=function(){this.CaptureDiv=document.createElement("div");var a=$(this.CaptureDiv);a.css("overflow","hidden");a.css("border-width",0);a.css("position","absolute");a.css("font-size","0px");a.css("margin","0px");a.css("padding","0px");a.css("id",this.Id);a.css("left",0);a.css("top",0);a.css("width","10000px");a.css("height","10000px");a.css("background-color","blue");a.css("opacity",0);a.css("z-index",10000);a.addClass("NNoSelect");a.select(function(){return false});$(document.body).append(this.CaptureDiv);return this.CaptureDiv};NClientHost.prototype.ReleaseCaptureDiv=function(){if(this.CaptureDiv!=null){$(this.CaptureDiv).remove();this.CaptureDiv=null}};NClientHost.prototype.Update=function(){var a=NRequest.GetAutoUpdateScriptRequest();this.ExecuteServiceRequest(a,NPostQueue2.AutoUpdateCategory)};NClientHost.prototype.SetAutoUpdate=function(a,b){if(this.AutoUpdate!=a||this.AutoUpdateInterval!=b){this.AutoUpdate=a;this.AutoUpdateInterval=b;this.PushUpdate()}};NClientHost.prototype.OnUpdate=function(){if(!this.AutoUpdate){return}this.Update();this.PushUpdate()};NClientHost.prototype.PushUpdate=function(){if(this.AutoUpdate){var a=this;setTimeout(function(){a.OnUpdate()},this.AutoUpdateInterval)}};NClientHost.prototype.ShowTooltip=function(g,i,a,e,f,c,d,h){var b=this.Tooltip;if(b!=null){if(b.GetText()==i){if(e){b.SetPosition(a);b.WaitOneIdle=true}else{if(b.State==NTooltip.StateShow){b.SetPosition(a)}}return}this.SafeDestroyTooltip()}if(i!=null&&i.length>0){this.Tooltip=new NTooltip(g,i,a,f,c,d,h);this.Tooltip.Show()}};NClientHost.prototype.SubmitFile=function(){alert("submit file");$(this.Controller.HtmlElement).append("
");var a="";var b="$(document).ready(function() {";b+="var el = document.getElementById('datafileBtn');";b+="var form = document.getElementById('submitForm');";b+="$(form).css('height', '20px');";b+="$(el).change(function() { ";b+="alert('changed');";b+="setTimeout(function () { form.submit(); }, 1000);";b+="});";b+="});";jQuery.globalEval(b)};function NViewHost(b,c){this.Parent=b;this.SetHtmlElement(document.createElement("div"));var a=$(this.HtmlElement);a.css("overflow","visible");a.css("position","absolute");a.css("font-size","0px");a.css("left",c.X+"px");a.css("top",c.Y+"px");a.css("width",c.Width+"px");a.css("height",c.Height+"px");a.addClass("NView");$(this.Parent.HtmlElement).append(this.HtmlElement);NHelpers.MarkAsNonSelectable(this.HtmlElement)}NViewHost.prototype=new NClientNode();function NStringStreamReader(){}NStringStreamReader.prototype.SetStream=function(a){this.Stream=a;this.Position=0;this.Length=this.Stream.length;this.Error=false};NStringStreamReader.prototype.Reset=function(){this.Position=0;this.Length=0;this.Stream=null;this.Error=false};NStringStreamReader.prototype.CanRead=function(){return this.Position=this.Length){this.Position=this.Length;this.Error=true;return""}var c=this.Stream.substring(this.Position,b);this.Position+=a+1;return c};NStringStreamReader.prototype.ReadNumber=function(){return Number(this.ReadToken())};NStringStreamReader.prototype.ReadString=function(){var a=this.ReadNumber();return this.ReadRawToken(a)};NStringStreamReader.prototype.ReadBoolean=function(){var a=this.ReadToken();return(a=="1")};NStringStreamReader.prototype.ReadRect=function(){return new NRect(this.ReadNumber(),this.ReadNumber(),this.ReadNumber(),this.ReadNumber())};NStringStreamReader.prototype.ReadPoint=function(){return new NPoint(this.ReadNumber(),this.ReadNumber())};NStringStreamReader.prototype.ReadSize=function(){return new NSize(this.ReadNumber(),this.ReadNumber())};NStringStreamReader.prototype.ReadImageMap=function(){var a=this.ReadString();if(a.length==0){return null}return NImageMap.FromString(a)};function NCommandProcessor(){}NCommandProcessor.prototype=new NStringStreamReader();NCommandProcessor.prototype.ProcessCommands=function(){while(this.CanRead()){var a=this.ReadString();if(!this.ProcessCommand(a)){alert("Failed to process client command ["+a+"]")}}};NCommandProcessor.prototype.ProcessCommand=function(a){return this.ProcessCommonCommand(a)};NCommandProcessor.prototype.ProcessCommonCommand=function(g){switch(g){case"ShowError":var t=this.ReadString();var k=new NErrorMessage();k.CreateErrorMessage(this.Host.Controller,t);return true;case"UnfreezeScrollbars":this.Host.FreezeScrolling=false;return true;case"StartScene":this.CurrentChildIndex=0;this.Host.FreezeScrolling=false;return true;case"EndScene":var h=this.Host.Controller;var i=this.CurrentChildIndex;if(i!=-1){var c=h.GetChildrenCount();h.RemoveChildrenInRange(i,c-1)}return true;case"ClearClientTools":this.Host.Controller.Tools=new Array();return true;case"ClearView":this.Host.Controller.RemoveAllChildren();return true;case"SetAutoUpdate":this.Host.SetAutoUpdate(this.ReadBoolean(),this.ReadNumber());return true;case"CreateToolbarSeparator":var J=new NToolbarSeparator();J.CreateToolbarSeparator(this.Host.Toolbar);return true;case"CreateToolbarButton":var e=this.ReadString();var r=this.ReadString();var L=this.ReadString();var d=this.ReadString();var j=this.ReadBoolean();var M=this.ReadBoolean();var G=new NToolbarButton(e);G.CreateToolbarButton(this.Host.Toolbar,r,L,M);if(d.length>0){G.ClickScript=d}G.SetEnabled(j);G.UpdateToolbarItem();return true;case"CreateToolbarCheckButton":var e=this.ReadString();var r=this.ReadString();var L=this.ReadString();var d=this.ReadString();var j=this.ReadBoolean();var M=this.ReadBoolean();var b=this.ReadBoolean();var H=new NToolbarCheckButton(e);H.CreateToolbarCheckButton(this.Host.Toolbar,r,L,M);if(d.length>0){H.ClickScript=d}H.SetEnabled(j);H.SetChecked(b);H.UpdateToolbarItem();return true;case"CreateToolbar":var I=this.ReadNumber();this.Host.Toolbar=new NToolbar(this.Host,I);return true;case"RemoveToolbar":if(this.Host.Toolbar!=null){this.Host.Toolbar.RemoveThis();this.Host.Toolbar=null}return true;case"UpdateSizes":var p=this.ReadSize();var O=this.ReadRect();var K=this.ReadSize();var o=this.Host;o.SetWidth(p.Width);o.SetHeight(p.Height);var N=o.ViewHost;if(N!=null){N.SetLeft(O.X);N.SetTop(O.Y);N.SetWidth(O.Width);N.SetHeight(O.Height)}var F=o.Toolbar;if(F!=null){F.SetWidth(K.Width);F.SetHeight(K.Height)}return true;case"AssignTileImageData":var e=this.ReadString();var r=this.ReadString();var q=this.ReadImageMap();var f=NClientNode.GetFromId(e);if(f!=null){f.Load(r,q)}return true;case"CreateBrowserRedirectTool":var C=this.ReadBoolean();this.Host.Controller.Tools.push(new NBrowserRedirectTool(C));return true;case"CreateCursorTool":this.Host.Controller.Tools.push(new NCursorTool());return true;case"CreateClientMouseEventTool":this.Host.Controller.Tools.push(new NClientMouseEventTool());return true;case"CreateServerMouseEventTool":var w=this.ReadBoolean();var z=this.ReadBoolean();var B=this.ReadBoolean();var y=this.ReadBoolean();var A=this.ReadBoolean();var x=this.ReadBoolean();var u=this.ReadBoolean();var v=this.ReadBoolean();this.Host.Controller.Tools.push(new NServerMouseEventTool(w,z,B,y,A,x,u,v));return true;case"CreatePostbackTool":this.Host.Controller.Tools.push(new NPostbackTool(this.ReadString(),this.ReadBoolean()));return true;case"CreateTooltipTool":var D=this.ReadNumber();var s=this.ReadNumber();var l=this.ReadNumber();var m=this.ReadNumber();var E=this.ReadNumber();var n=this.ReadBoolean();this.Host.Controller.Tools.push(new NTooltipTool(D,s,l,m,E,n));return true;case"CustomCommand":var a=this.ReadString();if(this.Host.CustomCommandCallback!=null){this.Host.CustomCommandCallback(a)}return true}return false};function NErrorMessage(){}NErrorMessage.prototype=new NClientNode();NErrorMessage.prototype.CreateErrorMessage=function(f,d){this.Parent=f;this.Parent.RemoveAllChildren();var a=document.createElement("div");$(f.HtmlElement).append(a);var b=$(a);b.css("border-width",0);b.css("overflow","auto");b.css("margin","0px");b.css("padding","0px");b.css("width","100%");b.css("height","100%");this.SetHtmlElement(a);var e=document.createElement("p");b.append(e);var c=$(e);c.css("text-align","center");c.css("font-size","14px");c.html(d)};function NController(b,c){this.Parent=b;this.Tools=new Array();this.ActiveTool=null;this.MouseCapture=false;this.SetHtmlElement(document.createElement("div"));NHelpers.MarkAsNonSelectable(this.HtmlElement);var a=$(this.HtmlElement);a.css("overflow","visible");a.css("position","relative");a.css("font-size","0px");a.css("left","0px");a.css("top","0px");a.css("border-width",0);a.css("margin",0);a.css("padding",0);a.css("width","100%");a.css("height","100%");this.BindToHtmlElement(this.HtmlElement);$(this.Parent.HtmlElement).append(this.HtmlElement)}NController.prototype=new NClientNode();NController.prototype.SetCapture=function(a){var d=this.HtmlElement;var c=this.GetRoot();var b;if(a){this.UnbindFromHtmlElement(d);b=c.CreateCaptureDiv();this.BindToHtmlElement(b);if(b.setCapture!=null){b.setCapture()}}else{b=c.CaptureDiv;if(b.releaseCapture!=null){b.releaseCapture()}this.UnbindFromHtmlElement(b);c.ReleaseCaptureDiv();this.BindToHtmlElement(d)}this.MouseCapture=a};NController.prototype.GetMouseEventArgs=function(a){var b=$(this.HtmlElement).offset();var c=a.pageX-b.left;var d=a.pageY-b.top;return new NMouseEventArgs(a,new NPoint(c,d),new NPoint(a.pageX,a.pageY))};NController.prototype.BindToHtmlElement=function(b){var a=this;var c=$(b);c.mousedown(function(d){return a.OnMouseDown(a.GetMouseEventArgs(d))});c.mouseover(function(d){return a.OnMouseOver(a.GetMouseEventArgs(d))});c.mouseup(function(d){return a.OnMouseUp(a.GetMouseEventArgs(d))});c.mouseleave(function(d){return a.OnMouseLeave(a.GetMouseEventArgs(d))});c.mouseenter(function(d){return a.OnMouseEnter(a.GetMouseEventArgs(d))});c.mousemove(function(d){return a.OnMouseMove(a.GetMouseEventArgs(d))});c.click(function(d){return a.OnClick(a.GetMouseEventArgs(d))});c.dblclick(function(d){return a.OnDoubleClick(a.GetMouseEventArgs(d))});c.keydown(function(d){return a.OnKeyDown(d)})};NController.prototype.UnbindFromHtmlElement=function(a){$(a).unbind()};NController.prototype.OnMouseDown=function(a){if((this.ActiveTool!=null)&&(!a.Canceled)){this.ActiveTool.OnMouseDown(this,a)}else{var b=0;for(b=0;bb){c=b-a}}return c};NImageHost.prototype.ClampY=function(c){if(c<0){c=0}else{var a=this.GetHeight();var b=this.Image.GetHeight();if((c+a)>b){c=b-a}}return c};NImageHost.prototype.SetOffsetX=function(a){a=this.ClampX(a);$(this.Image.HtmlElement).css("left",-a);var b=this.GetOffsetY();this.Image.UpdateRect(a,b,$(this.HtmlElement).width(),$(this.HtmlElement).height())};NImageHost.prototype.GetOffsetX=function(){return -Number($(this.Image.HtmlElement).css("left").replace("px",""))};NImageHost.prototype.SetOffsetY=function(a){a=this.ClampY(a);$(this.Image.HtmlElement).css("top",-a);var b=this.GetOffsetX();this.Image.UpdateRect(b,a,this.GetWidth(),this.GetHeight())};NImageHost.prototype.GetOffsetY=function(){return -Number($(this.Image.HtmlElement).css("top").replace("px",""))};NImageHost.prototype.SetLocation=function(a){a=this.ClampLocation(a);$(this.Image.HtmlElement).css("left",-a.X);$(this.Image.HtmlElement).css("top",-a.Y);this.Image.UpdateRect(a.X,a.Y,this.GetWidth(),this.GetHeight())};NImageHost.prototype.GetLocation=function(){return new NPoint(this.GetOffsetX(),this.GetOffsetY())};NImageHost.prototype.MatchHtmlParams=function(a){return this.Bounds.Equals(a)};function NTiledImage(h,b,a,e,g,f,d){this.NodeType=NClientNode.TiledImage;this.VirtualSize=h;this.CellSize=b;this.CacheSize=a;this.ImageRequestType=e;this.TiledServerIndex=g;this.ServiceUrl=f;this.LoaderUrl=d;this.Cells=new Array();this.CellCountX=this.GetMaxCellCount(h.Width,this.CellSize.Width);this.CellCountY=this.GetMaxCellCount(h.Height,this.CellSize.Height);var j=0;var k=0;this.SetHtmlElement(document.createElement("div"));var c=$(this.HtmlElement);c.css("width",h.Width+"px");c.css("height",h.Height+"px");c.css("margin",0);c.css("padding",0);c.css("border-width",0);c.css("position","relative");NHelpers.MarkAsNonSelectable(this.HtmlElement)}NTiledImage.prototype=new NImage();NTiledImage.prototype.MatchHtmlParams=function(f,b,a,c,e,d){return this.VirtualSize.Equals(f)&&this.CellSize.Equals(b)&&this.CacheSize.Equals(a)&&this.ImageRequestType==c&&this.TiledServerIndex==e&&this.ServiceUrl==d};NTiledImage.prototype.GetMaxCellCount=function(c,b){var a=Math.floor(c/b);if(a*b=this.CellCountX){return this.CellCountX-1}if(a<0){return 0}return a};NTiledImage.prototype.ClampCellY=function(a){if(a>=this.CellCountY){return this.CellCountY-1}if(a<0){return 0}return a};NTiledImage.prototype.Invalidate=function(){var b=this.Cells.length;var c;for(c=0;cj)||(el)){var a=this.GetCellAt(b,e);if(a!=null){a.AutoDelete=false}}}}this.AutoDelete()};NTiledImage.prototype.GetImageUrlForIdAndRect=function(b,e,f,d,a){var c=new NRequestList();c.Requests.push(NRequest.GetCustomStreamImageRequest(this.ImageRequestType,b,this.TiledServerIndex,e,f,d,a));c.Requests.push(NRequest.GetEnforceBrowserRefreshRequest());return this.ServiceUrl+NRequestList.RequestDelimeter+c.Pack()};function NTiledImageCell(d,f,g){this.Parent=d;this.CellX=f;this.CellY=g;this.SetHtmlElement(new Image());NHelpers.MarkAsNonSelectable(this.HtmlElement);var e=this.GetRect();var a=this.HtmlElement;var c=$(a);var b=this;c.css("margin","0px");c.css("padding","0px");c.css("border-width","0px");c.css("position","absolute");c.css("left",e.X+"px");c.css("top",e.Y+"px");c.css("width",e.Width+"px");c.css("height",e.Height+"px");c.css("display","none");a.onload=function(){c.css("display","block");c.onload=null;b.Loaded=true;b.HideLoader()};$(this.Parent.HtmlElement).append(this.HtmlElement);this.Loaded=false;this.LoaderDiv=null;this.AutoDelete=false;this.StartLoad()}NTiledImageCell.prototype=new NClientNode();NTiledImageCell.prototype.GetRect=function(){return new NRect(this.Parent.CellSize.Width*this.CellX,this.Parent.CellSize.Height*this.CellY,this.Parent.CellSize.Width,this.Parent.CellSize.Height)};NTiledImageCell.prototype.Load=function(b,a){this.HtmlElement.src=b;this.ImageMap=a;this.Loaded=true};NTiledImageCell.prototype.AbortLoad=function(){if(!this.Loaded){var a=this.GetRoot();a.PostQueue.AbortRequestWithId(this.RequestId);this.RequestId=-1;this.HideLoader()}};NTiledImageCell.prototype.StartLoad=function(){if(!this.Loaded){var a=this.GetRoot();var c=this.GetRect();if(this.HtmlElement.src==null||this.HtmlElement.src.length==0){this.ShowLoader()}var b=this.Parent.GetImageUrlForIdAndRect($(this.HtmlElement).attr("id"),c.X,c.Y,c.Width,c.Height);this.RequestId=a.UrlPost(b,null,NPostQueue2.TopPriority)}};NTiledImageCell.prototype.RemoveThis=function(){if(this.HtmlElement!=null){this.AbortLoad();this.RemoveFromTree();this.HideLoader()}};NTiledImageCell.prototype.ShowLoader=function(){var d=this.Parent.LoaderUrl;if(this.LoaderDiv!=null||d==null||d.length==0){return}var a=$(this.HtmlElement);var e=this.GetRect();var c=document.createElement("div");this.LoaderDiv=c;var b=$(c);b.css("position","absolute");b.css("left",e.X+"px");b.css("top",e.Y+"px");b.css("width",e.Width+"px");b.css("height",e.Height+"px");b.css("margin",0);b.css("padding",0);b.css("border-width",0);b.css("background-repeat","no-repeat");b.css("background-image","url('"+this.Parent.LoaderUrl+"')");b.css("background-position","center");$(this.Parent.HtmlElement).append(c)};NTiledImageCell.prototype.HideLoader=function(){if(this.LoaderDiv!=null){$(this.LoaderDiv).remove();this.LoaderDiv=null}};function NImageMap(){this.Infos=new Array();this.Areas=new Array()}NImageMap.prototype.GetInfoFromPoint=function(d){var b=this.Areas.length;var c;for(c=b-1;c>=0;c--){var a=this.Areas[c];if(a.Shape.Contains(d)){return this.Infos[a.InfoIndex]}}return null};NImageMap.FromString=function(o){var n=new NStringStreamReader();var e=new NImageMap();n.SetStream(o);var g=n.ReadNumber();var d=0;for(d=0;d0){c+=NRequestList.RequestDelimeter}c+=b.Pack()}return c};NRequestList.Unpack=function(c){var b=new Array();var d=c.split(NRequestList.RequestDelimeter);var a=0;for(a=0;a0){d+=this.ParamDelimiter}d+=b.Name;d+=this.NameValueDelimeter;d+=b.Value}return d};NParameterList.Unpack=function(e){var d=new Array();var c=e.split(this.ParamDelimiter);var a=0;for(a=0;aposition){b.LargeScrollLeft()}else{if((b.GetThumbPosition()+b.GetThumbSize())this.Max-this.LargeStep){a=this.Max-this.LargeStep}if(a0){d.css("background-image","url('"+c+"')")}this.Size=f;this.CreateButtonBase();this.UpdateButton()}NScrollbarButton.prototype=new NButtonBase();NScrollbarButton.prototype.IsPressed=function(){return(this.GetPressed()&&this.GetMouseOver())||(this.Parent.Dragging&&this.Parent.ThumbButton==this)};function NHScrollbar(){}NHScrollbar.prototype=new NScrollbar();NHScrollbar.prototype.Create=function(e,f,h,g,d,c,k,b,i,j,a){this.Parent=e;this.Min=d;this.Max=c;this.SmallStep=k;this.LargeStep=b;this.ScrollValue=i;this.ScrollbarInflate=h;this.ScrollbarButtonInflate=g;this.ServiceUrl=j;this.GlyphUrl=a;this.Horizontal=true;this.NodeType=NClientNode.HScrollbar;this.Bounds=f.Inflate(h.Negate());this.ButtonSize=this.Bounds.Height;this.CreateContainerDiv(this.Bounds);$(this.Parent.HtmlElement).append(this.HtmlElement);var l=new NSize(this.Bounds.Height,this.Bounds.Height);l=l.Inflate(g.Negate());this.LeftButton=new NScrollbarButton(this,l,a);this.PositionScrollButton(true,this.LeftButton);$(this.HtmlElement).append(this.LeftButton.HtmlElement);var m=new NSize(this.GetThumbSize(),l.Height);this.ThumbButton=new NScrollbarButton(this,m,"");this.PositionScrollButton(true,this.ThumbButton);$(this.HtmlElement).append(this.ThumbButton.HtmlElement);this.RightButton=new NScrollbarButton(this,l,a);this.PositionScrollButton(false,this.RightButton);$(this.HtmlElement).append(this.RightButton.HtmlElement);this.SetValue(this.ScrollValue);$(this.HtmlElement).css("position","absolute");this.BindToEvents()};NHScrollbar.prototype.PositionScrollButton=function(c,a){var b=a.HtmlElement;$(b).css("top",0);if(c){$(b).css("left",0);$(b).css("background-position","0px 0px")}else{$(b).css("left",(this.Bounds.Width-this.ButtonSize)+"px");$(b).css("background-position","32px 0px")}return a};NHScrollbar.prototype.SetValue=function(d){var a=this.GetRoot();if(a!=null&&a.FreezeScrolling){return false}var b=this.ClampLogicalValue(d);var c=this.ScrollValue;this.ScrollValue=b;$(this.ThumbButton.HtmlElement).css("left",this.ButtonSize+this.GetThumbPosition());var e=b!=c;if(e&&this.ValueChanged!=null){this.ValueChanged(this)}return e};NHScrollbar.prototype.SetThumbSize=function(a){this.ThumbButton.SetWidth(a)};function NVScrollbar(){}NVScrollbar.prototype=new NScrollbar();NVScrollbar.prototype.Create=function(e,f,h,g,d,c,k,b,i,j,a){this.Parent=e;this.Min=d;this.Max=c;this.SmallStep=k;this.LargeStep=b;this.ScrollValue=i;this.ScrollbarInflate=h;this.ScrollbarButtonInflate=g;this.ServiceUrl=j;this.GlyphUrl=a;this.Horizontal=false;this.NodeType=NClientNode.VScrollbar;this.Bounds=f.Inflate(h.Negate());this.ButtonSize=this.Bounds.Width;this.CreateContainerDiv(this.Bounds);$(this.Parent.HtmlElement).append(this.HtmlElement);var l=new NSize(this.Bounds.Width,this.Bounds.Width);l=l.Inflate(g.Negate());this.LeftButton=new NScrollbarButton(this,l,a);this.PositionScrollButton(true,this.LeftButton);$(this.HtmlElement).append(this.LeftButton.HtmlElement);var m=new NSize(l.Width,this.GetThumbSize());this.ThumbButton=new NScrollbarButton(this,m,"");this.PositionScrollButton(true,this.ThumbButton);$(this.HtmlElement).append(this.ThumbButton.HtmlElement);this.RightButton=new NScrollbarButton(this,l,a);this.PositionScrollButton(false,this.RightButton);$(this.HtmlElement).append(this.RightButton.HtmlElement);this.SetValue(this.ScrollValue);$(this.HtmlElement).css("position","absolute");this.BindToEvents()};NVScrollbar.prototype.PositionScrollButton=function(c,a){var b=a.HtmlElement;$(b).css("left",0);if(c){$(b).css("top",0);$(b).css("background-position","48px 0px")}else{$(b).css("top",(this.Bounds.Height-this.ButtonSize)+"px");$(b).css("background-position","16px 0px")}return a};NVScrollbar.prototype.SetValue=function(d){var a=this.GetRoot();if(a!=null&&a.FreezeScrolling){return false}var b=this.ClampLogicalValue(d);var c=this.ScrollValue;this.ScrollValue=b;$(this.ThumbButton.HtmlElement).css("top",this.ButtonSize+this.GetThumbPosition());var e=b!=c;if(e&&this.ValueChanged!=null){this.ValueChanged(this)}return e};NVScrollbar.prototype.SetThumbSize=function(a){this.ThumbButton.SetHeight(a)};function NTool(){}NTool.prototype.constructor=NTool;NTool.prototype.OnMouseDown=function(a,b){};NTool.prototype.OnMouseMove=function(a,b){};NTool.prototype.OnMouseUp=function(a,b){};NTool.prototype.OnMouseLeave=function(a,b){};NTool.prototype.OnMouseOver=function(a,b){};NTool.prototype.OnMouseEnter=function(a,b){};NTool.prototype.OnDoubleClick=function(a,b){};NTool.prototype.OnClick=function(a,b){};NTool.prototype.OnKeyDown=function(a,b){};NTool.prototype.OnTimer=function(a,b){};NTool.prototype.Destroy=function(a){};function NTooltip(e,h,f,c,a,b,g){this.InitialDelay=c;this.PopDelay=g;this.FadeInDelay=a;this.FadeOutDelay=b;this.Visible=false;this.Destroyed=false;this.CanFadeOut=true;this.Parent=e;this.WaitOneIdle=false;this.State=NTooltip.StateShow;this.Content=document.createElement("div");var d=$(this.Content);d.css("visibility","hidden");d.css("position","absolute");d.addClass("NTooltip");d.addClass("NNoSelect");d.select(function(){return false});this.SetPosition(f);this.SetText(h);$(document.body).append(this.Content);if(e!=null){e.BindToHtmlElement(this.Content)}}NTooltip.StateShow=1;NTooltip.StateFadeIn=2;NTooltip.StateIdle=3;NTooltip.StateFadeOut=4;NTooltip.prototype.SetPosition=function(b){var a=$(this.Content);a.css("left",b.X+"px");a.css("top",b.Y+20+"px")};NTooltip.prototype.SetText=function(b){var a=$(this.Content);a.empty();a.append(b)};NTooltip.prototype.GetText=function(){return $(this.Content).html()};NTooltip.prototype.Hide=function(){$(this.Content).css("visibility","hidden")};NTooltip.prototype.Show=function(){var a=this;this.State=NTooltip.StateShow;if(!this.Destroyed){setTimeout(function(){a.OnFadeIn()},this.InitialDelay)}};NTooltip.prototype.OnFadeIn=function(){var b=this;this.Visible=true;if(!this.Destroyed){var a=$(this.Content);this.Visible=true;a.css("visibility","visible");this.State=NTooltip.FadeIn;a.fadeIn(this.FadeInDelay,function(){b.OnIdle()})}};NTooltip.prototype.OnIdle=function(){if(!this.Destroyed){var a=this;this.State=NTooltip.Idle;setTimeout(function(){a.OnFadeOut()},this.PopDelay)}};NTooltip.prototype.OnIdleExit=function(){if(this.WaitOneIdle){this.OnIdle()}else{this.OnFadeOut()}};NTooltip.prototype.OnFadeOut=function(){if(!this.Destroyed){var a=this;this.State=NTooltip.FadeOut;$(this.Content).fadeOut(this.FadeOutDelay,function(){a.Hide()})}};NTooltip.prototype.Destroy=function(){if(!this.Destroyed){this.Destroyed=true;this.Hide();$(this.Content).remove();if(this.Parent!=null){this.Parent.UnbindFromHtmlElement(this.Content)}}};function NTooltipTool(e,d,a,b,f,c){this.PopDelay=e;this.InitialDelay=d;this.FadeInDelay=a;this.FadeOutDelay=b;this.ReshowDelay=f;this.FollowMouse=c}NTooltipTool.prototype=new NTool();NTooltipTool.prototype.constructor=NTooltipTool();NTooltipTool.prototype.OnMouseLeave=function(a,b){};NTooltipTool.prototype.OnMouseMove=function(b,c){var d=b.GetRoot();var a=d.GetImageMapInfo(c);var f="";if(a!=null){f=a.GetTitle()}d.ShowTooltip(b,f,c.PageCoords,this.FollowMouse,this.InitialDelay,this.FadeInDelay,this.FadeOutDelay,this.PopDelay)};function NBrowserRedirectTool(a){this.OpenInNewWindow=a}NBrowserRedirectTool.prototype=new NTool();NBrowserRedirectTool.prototype.constructor=NBrowserRedirectTool();NBrowserRedirectTool.prototype.OnMouseDown=function(b,c){if(c.Event.which!=1){return}var a=b.GetRoot().GetImageMapInfo(c);if(a==null){return}var d=a.GetUrl();if(d==null||d.length==0){return}if(this.OpenInNewWindow){window.open(d)}else{window.location=d}c.Cancel()};function NCursorTool(){this.Tooltip=null;this.OpenInNewWindow=false}NCursorTool.prototype=new NTool();NCursorTool.prototype.constructor=NCursorTool();NCursorTool.prototype.OnMouseMove=function(b,d){var a=b.GetRoot().GetImageMapInfo(d);var f=true;var c;if(a!=null){f=false;c=a.GetCursor()}if(f||c==null){$(b.HtmlElement).css("cursor","default")}else{$(b.HtmlElement).css("cursor",c)}};NCursorTool.prototype.OnMouseLeave=function(a,b){$(a.HtmlElement).css("cursor","default")};function NDragTool(){this.Dragging=false;this.MouseBegin=null;this.MouseEnd=null}NDragTool.prototype=new NTool();NDragTool.prototype.constructor=NDragTool();NDragTool.prototype.OnMouseDown=function(a,b){if(!this.Dragging&&this.BeginDrag(a,b)){this.Dragging=true;this.MouseBegin=b;b.Cancel()}};NDragTool.prototype.OnMouseMove=function(a,b){if(this.Dragging){this.MouseEnd=b;this.DoDrag(a,b);b.Cancel()}};NDragTool.prototype.OnMouseUp=function(a,b){if(this.Dragging){this.MouseEnd=b;this.EndDrag(a,b);b.Cancel()}};NDragTool.prototype.OnKeyDown=function(a,b){if(this.Dragggin&&b.keyCode==27){this.CancelDrag(a,null)}};NDragTool.prototype.GetDragWidth=function(){return this.MouseEnd.RelativeCoords.X-this.MouseBegin.RelativeCoords.X};NDragTool.prototype.GetDragHeight=function(){return this.MouseEnd.RelativeCoords.Y-this.MouseBegin.RelativeCoords.Y};NDragTool.prototype.BeginDrag=function(a,b){a.ActiveTool=this};NDragTool.prototype.DoDrag=function(a,b){};NDragTool.prototype.CancelDrag=function(a,b){a.ActiveTool=null;this.Dragging=false};NDragTool.prototype.EndDrag=function(a,b){a.ActiveTool=null;this.Dragging=false};function NDrawDivTool(){this.Dragging=false;this.DragDiv=null;this.AnchorPoint=null}NDrawDivTool.prototype=new NDragTool();NDrawDivTool.prototype.BeginDragDiv=function(a,c){var b=NHelpers.CreateEmptyDiv();this.DragDiv=b;$(b).css("position","absolute");$(b).css("left",c.RelativeCoords.X);$(b).css("top",c.RelativeCoords.Y);$(b).mousedown(function(f){NHelpers.StopPropagation(f)});$(b).mousemove(function(f){NHelpers.StopPropagation(f)});var d=a.HtmlElement;NHelpers.MarkAsNonSelectable(b);$(d).append(b);a.SetCapture(true);a.ActiveTool=this;return true};NDrawDivTool.prototype.BeginDrag=function(a,b){return true};NDrawDivTool.prototype.DoDrag=function(a,b){this.UpdateDragDiv()};NDrawDivTool.prototype.UpdateDragDiv=function(){$(this.DragDiv).css("visibility","visible");var b=this.GetDragWidth();var a=this.GetDragHeight();if(b>=0){$(this.DragDiv).css("width",b);$(this.DragDiv).css("left",this.MouseBegin.RelativeCoords.X)}else{$(this.DragDiv).css("width",-b);$(this.DragDiv).css("left",this.MouseBegin.RelativeCoords.X+b)}if(a>=0){$(this.DragDiv).css("height",a);$(this.DragDiv).css("top",this.MouseBegin.RelativeCoords.Y)}else{$(this.DragDiv).css("height",-a);$(this.DragDiv).css("top",this.MouseBegin.RelativeCoords.Y+a)}};NDrawDivTool.prototype.CancelDrag=function(a,b){$(this.DragDiv).remove();a.ActiveTool=null;this.Dragging=false;a.SetCapture(false)};NDrawDivTool.prototype.EndDrag=function(a,b){this.CancelDrag(a,b)};function NServerMouseEventTool(c,f,h,e,g,d,a,b){this.MouseDown=c;this.MouseMove=f;this.MouseUp=h;this.MouseLeave=e;this.MouseOver=g;this.MouseEnter=d;this.MouseClick=a;this.MouseDoubleClick=b}NServerMouseEventTool.prototype=new NTool();NServerMouseEventTool.prototype.OnMouseDown=function(a,b){if(this.MouseDown){a.GetRoot().ExecuteServiceRequest(NRequest.GetFireServerMouseEventRequest(0,b.RelativeCoords,b.Event.which))}};NServerMouseEventTool.prototype.OnMouseMove=function(a,b){if(this.MouseMove){a.GetRoot().ExecuteServiceRequest(NRequest.GetFireServerMouseEventRequest(1,b.RelativeCoords,b.Event.which),NPostQueue2.UpdateCategory)}};NServerMouseEventTool.prototype.OnMouseUp=function(a,b){if(this.MouseUp){a.GetRoot().ExecuteServiceRequest(NRequest.GetFireServerMouseEventRequest(2,b.RelativeCoords,b.Event.which))}};NServerMouseEventTool.prototype.OnMouseLeave=function(a,b){if(this.MouseLeave){a.GetRoot().ExecuteServiceRequest(NRequest.GetFireServerMouseEventRequest(3,b.RelativeCoords,b.Event.which))}};NServerMouseEventTool.prototype.OnMouseOver=function(a,b){if(this.MouseOver){a.GetRoot().ExecuteServiceRequest(NRequest.GetFireServerMouseEventRequest(4,b.RelativeCoords,b.Event.which),NPostQueue2.UpdateCategory)}};NServerMouseEventTool.prototype.OnMouseEnter=function(a,b){if(this.MouseEnter){a.GetRoot().ExecuteServiceRequest(NRequest.GetFireServerMouseEventRequest(5,b.RelativeCoords,b.Event.which))}};NServerMouseEventTool.prototype.OnClick=function(a,b){if(this.MouseClick){a.GetRoot().ExecuteServiceRequest(NRequest.GetFireServerMouseEventRequest(6,b.RelativeCoords,b.Event.which))}};NServerMouseEventTool.prototype.OnDoubleClick=function(a,b){if(this.MouseDoubleClick){a.GetRoot().ExecuteServiceRequest(NRequest.GetFireServerMouseEventRequest(7,b.RelativeCoords,b.Event.which))}};function NClientMouseEventTool(){this.CurrentArea=null}NClientMouseEventTool.prototype=new NTool();NClientMouseEventTool.prototype.constructor=NClientMouseEventTool();NClientMouseEventTool.prototype.ExecuteScript=function(d,b,c){var a=b.GetRoot().GetImageMapInfo(c);if(a==null){return}this.ExecuteAreaScript(a,d)};NClientMouseEventTool.prototype.ExecuteAreaScript=function(a,b){var c=a.GetAttribute(b);if(c==null||c.length==0){return}jQuery.globalEval(c)};NClientMouseEventTool.prototype.OnMouseDown=function(a,b){this.ExecuteScript("mousedown",a,b)};NClientMouseEventTool.prototype.OnMouseMove=function(b,c){var a=b.GetRoot().GetImageMapInfo(c);if(a!=this.CurrentArea){if(this.CurrentArea!=null){this.ExecuteAreaScript(this.CurrentArea,"mouseleave")}if(a!=null){this.ExecuteAreaScript(a,"mouseenter")}this.CurrentArea=a}this.ExecuteScript("mousemove",b,c)};NClientMouseEventTool.prototype.OnMouseUp=function(a,b){this.ExecuteScript("mouseup",a,b)};NClientMouseEventTool.prototype.OnMouseLeave=function(a,b){if(this.CurrentArea!=null){this.ExecuteAreaScript(this.CurrentArea,"mouseleave");this.CurrentArea=null}};NClientMouseEventTool.prototype.OnMouseOver=function(a,b){this.ExecuteScript("mouseover",a,b)};NClientMouseEventTool.prototype.OnMouseEnter=function(a,b){this.ExecuteScript("mouseenter",a,b)};NClientMouseEventTool.prototype.OnDoubleClick=function(a,b){this.ExecuteScript("dblclick",a,b)};NClientMouseEventTool.prototype.OnClick=function(a,b){this.ExecuteScript("click",a,b)};function NPostbackTool(a,b){this.PostackEventReference=a;this.PostbackOnInteractiveItemsOnly=b}NPostbackTool.prototype=new NTool();NPostbackTool.prototype.constructor=new NPostbackTool();NPostbackTool.prototype.OnClick=function(controller,e){if(this.PostbackOnInteractiveItemsOnly){var area=controller.GetRoot().GetImageMapInfo(e);if(area==null){return}}var postbackScript=this.PostackEventReference;var params=String(e.RelativeCoords.X)+","+String(e.RelativeCoords.Y)+","+String(e.PageCoords.X)+","+String(e.PageCoords.Y);postbackScript=postbackScript.replace("NPostbackEventArguments",params);eval(postbackScript)};function NToolbar(c,a){this.Parent=c;this.SetHtmlElement(document.createElement("div"));var b=$(this.HtmlElement);b.css("overflow","hidden");b.css("height",a+"px");b.addClass("NToolBar");$(this.Parent.HtmlElement).prepend(this.HtmlElement)}NToolbar.prototype=new NClientNode();function NToolbarItem(){this.Enabled=true;this.Parent=null}NToolbarItem.prototype=new NButtonBase();NToolbarItem.prototype.CreateToolbarItem=function(parent,rawImage,tooltipText,unpressOnResponse){this.Parent=parent;this.SetHtmlElementNoId(document.createElement("div"));var jElement=$(this.HtmlElement);jElement.attr("id",this.Id);jElement.css("float","left");jElement.css("font-size","0px");jElement.css("overflow","hidden");$(this.Parent.HtmlElement).append(this.HtmlElement);var toolbarItem=this;var image=new Image();var jImage=$(image);image.src=rawImage;jImage.css("margin","0px");jImage.css("padding","0px");jImage.css("border-width","0px");jImage.css("width","16px");jImage.css("height","16px");jElement.append(image);if(tooltipText.length>0){jElement.mousemove(function(e){var host=toolbarItem.GetRoot();if(host!=null){var coordinates=new NPoint(e.pageX,e.pageY);host.ShowTooltip(null,tooltipText,coordinates,false,1000,200,200,1000)}})}this.CreateButtonBase();jElement.mousedown(function(e){if(e.which!=1){return}if(toolbarItem.GetEnabled()&&toolbarItem.ClickScript!=null&&toolbarItem.ClickScript.length>0){eval(toolbarItem.ClickScript)}if(!unpressOnResponse){setTimeout(function(){toolbarItem.SetPressed(false);toolbarItem.UpdateButton()},20)}});if(unpressOnResponse){jElement.unbind("mouseup")}else{}};NToolbarItem.prototype.UpdateToolbarItem=function(){this.UpdateButton()};function NToolbarButton(a){this.Id=a}NToolbarButton.prototype=new NToolbarItem();NToolbarButton.prototype.CreateToolbarButton=function(a,b,c,d){$(this.HtmlElement).addClass("NToolbarButton");this.CreateToolbarItem(a,b,c,d)};function NToolbarCheckButton(a){this.Id=a}NToolbarCheckButton.prototype=new NToolbarButton();NToolbarCheckButton.prototype.CreateToolbarCheckButton=function(a,b,c,d){this.CreateToolbarButton(a,b,c,d)};NToolbarButton.prototype.UpdateButtonStyles=function(){if(this.HtmlElement==null){return}var a=this;var b=$(this.HtmlElement);if(a.GetEnabled()){if(a.GetPressed()||a.GetChecked()){b.removeClass("NStateHover").addClass("NStatePressed");return}if(a.IsMouseOver()){b.removeClass("NStatePressed").addClass("NStateHover");return}}b.removeClass("NStatePressed NStateHover")};function NToolbarSeparator(){}NToolbarSeparator.prototype=new NClientNode();NToolbarSeparator.prototype.CreateToolbarSeparator=function(b){this.Parent=b;this.SetHtmlElementNoId(document.createElement("div"));var a=$(this.HtmlElement);a.attr("id",this.Id);a.css("float","left");a.css("font-size","0px");a.addClass("NToolbarSeparator");$(this.Parent.HtmlElement).append(this.HtmlElement)};